#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<sys/types.h>
#include<sys/wait.h>
#include<unistd.h>
#include<errno.h>

int main(){
  printf("我的程序要开始运行了！\n");
  if(fork() == 0)
  {
      printf("I am Child, MY Pid Is : %d\n", getpid());
      //execl("/usr/bin/ls","/usr/bin/ls", "-ln" NULL);
      
      execlp("ls","ls", "-ln", NULL);
      sleep(1);
     // char* const argv[] = {(char* const)"ls",(char* const) "-l", NULL};
     // execv("/usr/bin/ls", argv);
     // execvp(argv[0], argv);
      exit(1);
  }
  waitpid(-1, NULL, 0);
  printf("我的程序运行完成了\n");
  exit(1);

}
